package com.lipl.base.javase.designpattern.observer.geradvice;

/**
 * @Auther: 15541
 * @Date: 2020/12/16 16:30
 * @Description:
 */
public class ObserverTest {

    public static void main(String[] args) {
        GPer gper = GPer.getInstance();
        Teacher tom = new Teacher("tom");
        Teacher mic = new Teacher("mic");

        //这位同学没有@Tom老师
        Question question = new Question();
         question.setUserName("小明");
        question.setContent("观察者设计模式适用于那些场景？");
        gper.addObserver(tom);
        gper.addObserver(mic);
        gper.publishQuestion(question);
    }
}

